/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ventanas;

import java.awt.Image;
import java.awt.Toolkit;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author crey
 */
public class MainWindows extends javax.swing.JFrame {

    /**
     * Creates new form MainWindows
     */
    public MainWindows() {
        initComponents();
        Image icono = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("imagen/icono.jpg"));
        this.setIconImage(icono);
        this.setExtendedState(MAXIMIZED_BOTH);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        desktop = new javax.swing.JDesktopPane();
        btn_salir = new javax.swing.JButton();
        btn_cliente = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        btn_proveedor = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        mnu_cliente = new javax.swing.JMenuItem();
        mnu_proveedor = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        mnu_cat = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mnu_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema de Control de Stock");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setLocationByPlatform(true);
        getContentPane().setLayout(new java.awt.GridLayout(1, 0));

        btn_salir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btn_salir.setText("Salir");
        btn_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_salirActionPerformed(evt);
            }
        });
        btn_salir.setBounds(10, 440, 120, 70);
        desktop.add(btn_salir, javax.swing.JLayeredPane.DEFAULT_LAYER);

        btn_cliente.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btn_cliente.setText("Clientes");
        btn_cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_clienteActionPerformed(evt);
            }
        });
        btn_cliente.setBounds(10, 130, 120, 70);
        desktop.add(btn_cliente, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jButton3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton3.setText("Compras");
        jButton3.setBounds(10, 280, 120, 70);
        desktop.add(jButton3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        btn_proveedor.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btn_proveedor.setText("Proveedores");
        btn_proveedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_proveedorActionPerformed(evt);
            }
        });
        btn_proveedor.setBounds(10, 210, 119, 60);
        desktop.add(btn_proveedor, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jButton5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton5.setText("Ventas");
        jButton5.setBounds(10, 360, 120, 70);
        desktop.add(jButton5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        getContentPane().add(desktop);

        jMenu1.setText("Operaciones");

        jMenu4.setText("ABM's");

        mnu_cliente.setText("Clientes");
        mnu_cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnu_clienteActionPerformed(evt);
            }
        });
        jMenu4.add(mnu_cliente);

        mnu_proveedor.setText("Proveedores");
        mnu_proveedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnu_proveedorActionPerformed(evt);
            }
        });
        jMenu4.add(mnu_proveedor);

        jMenuItem3.setText("Productos");
        jMenu4.add(jMenuItem3);

        mnu_cat.setText("Categoria de Productos");
        mnu_cat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnu_catActionPerformed(evt);
            }
        });
        jMenu4.add(mnu_cat);

        jMenu1.add(jMenu4);

        jMenuItem4.setText("Ventas");
        jMenu1.add(jMenuItem4);

        jMenuItem5.setText("Compras");
        jMenu1.add(jMenuItem5);
        jMenu1.add(jSeparator1);

        mnu_salir.setText("Salir");
        mnu_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnu_salirActionPerformed(evt);
            }
        });
        jMenu1.add(mnu_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Reportes");

        jMenuItem7.setText("Listado de Productos por Categoria");
        jMenu2.add(jMenuItem7);

        jMenuItem8.setText("Listado de Productos con Stock Minimo");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem8);

        jMenuItem9.setText("Listado de Ventas por Fecha");
        jMenu2.add(jMenuItem9);

        jMenuItem10.setText("Listado de Compras por Fecha");
        jMenu2.add(jMenuItem10);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-939)/2, (screenSize.height-672)/2, 939, 672);
    }// </editor-fold>//GEN-END:initComponents

    private void mnu_clienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnu_clienteActionPerformed
        try {
            FrmCliente frm = new FrmCliente();
            frm.setEnabled(true);
            frm.setSelected(true);
            this.desktop.add(frm);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainWindows.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_mnu_clienteActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void mnu_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnu_salirActionPerformed
        this.dispose();
    }//GEN-LAST:event_mnu_salirActionPerformed

    private void btn_clienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_clienteActionPerformed
        this.mnu_clienteActionPerformed(null);
    }//GEN-LAST:event_btn_clienteActionPerformed

    private void btn_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_salirActionPerformed
        this.mnu_salirActionPerformed(null);
    }//GEN-LAST:event_btn_salirActionPerformed

    private void mnu_catActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnu_catActionPerformed
        try {
            FrmCategoriaProducto frm = new FrmCategoriaProducto();
            frm.setEnabled(true);
            frm.setSelected(true);
            this.desktop.add(frm);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainWindows.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_mnu_catActionPerformed

    private void btn_proveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_proveedorActionPerformed
        try {
            FrmProveedor frm = new FrmProveedor();
            frm.setEnabled(true);
            frm.setSelected(true);
            this.desktop.add(frm);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainWindows.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btn_proveedorActionPerformed

    private void mnu_proveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnu_proveedorActionPerformed
            this.btn_proveedorActionPerformed(null);
    }//GEN-LAST:event_mnu_proveedorActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MainWindows().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_cliente;
    private javax.swing.JButton btn_proveedor;
    private javax.swing.JButton btn_salir;
    private javax.swing.JDesktopPane desktop;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton5;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JMenuItem mnu_cat;
    private javax.swing.JMenuItem mnu_cliente;
    private javax.swing.JMenuItem mnu_proveedor;
    private javax.swing.JMenuItem mnu_salir;
    // End of variables declaration//GEN-END:variables
}
